import request from "@/utils/request.js";





//首页秒杀导航栏
export function seckillNav() {
  return request.get("seckill/header", {}, { noAuth: true });
}

//首页商品展示
export function productIndex() {
  return request.get("index/product", {}, { noAuth: true });
}


// //添加收款地址
export function receivingAddress(data) {
  return request.post("receivingAddress", data);
}

// 获取地址
export function getAddress(data) {
  return request.post("getUserReceivingAddress", data);
}
//商城 获取分类
export function getCategory() {
  return request.get("category", {}, { noAuth: true });
}

// export function getProducts(id,val) {
//   return request.get("products", {cid:id,keyword:val}, { noAuth: true });
// }
export function getProducts(data) {
  return request.get("products", data, { noAuth: true });
}
//首页商品 查询
export function getIndexProducts(data) {
  return request.get("products", data, { noAuth: true });
}

//预约抢拍界面
export function seckill() {
  return request.get("seckill/reservationSeckill", { noAuth: true });
}
//点击预约
export function goReservation(id) {
  return request.get("reservation",{shippingSessionsId:id},{ noAuth: true });
}
//秒杀列表
export function listSeckill() {
  return request.get("productSaleConfig/list",{ noAuth: true });
}
// 创建 搶拍订单
export function purchase(data) {
  return request.post("order/create", data,{ noAuth: true });
}
//抢拍--抢购

/**
 * 用户创建预订单
 * 
 * @param obj obj
*/

export function seckillBuy(obj) {
  return request.post("seckill/seckillPool1",obj,{ noAuth: true });
}
//查看 卖家订单信息 详情
export function OrderInfo(id) {
  return request.get("getUserWarehouseSellOrderInfo",{orderNo:id},{ noAuth: true });
}

//  确认 订单 详情
export function comfirmDetail(id) {
  return request.get("userWarehouseSellInfoPay",{id:id},{ noAuth: true });
}

//查看 买家订单信息 详情
export function OrderBuyIn(id) {
  return request.get("getUserWarehousePayOrderInfo",{orderNo:id},{ noAuth: true });
}

//买家立即支付
export function OrderDetail(id) {
  return request.get("userWarehousePayNowPay",{id:id},{ noAuth: true });
}
//用户 买 仓库
export function userWarehousePay(data) {
  return request.get("userWarehousePay",data,{ noAuth: true });
}
//用户 卖 仓库
export function userWarehouseSell(data) {
  return request.get("userWarehouseSell",data,{ noAuth: true });
}


// 寄拍 和 快递
export function selectPass(data) {
  return request.post("selectPassAndPhotos",data,{ noAuth: true });
}

//代理金

export function getNowMoney(data) {
  return request.get("getNowMoney",data,{ noAuth: true });
}
//寄售收益
export function consignment() {
  return request.get("consignmentIncome",{ noAuth: true });
}
//个人信息
export function userInfo() {
  return request.get("user",{ noAuth: true });
}
// 校验 交易密码
export function recordPwd(data) {
  return request.get("user/comfirmTransPwd", data);
}

// 修改 交易密码
export function updatePwd(data) {
  return request.get("user/updateTransPwd",data);
}


// 实名认证
export function realName(data) {
  return request.post("user/realNameAuthentication",data,{ noAuth: true });
}

// 上传图片
export function userUpload(data) {
  return request.post("userAuthCollectionUpload",data,{ noAuth: true });
}

// 获取团队信息
export function teamInfo() {
  return request.get("team/info",{ noAuth: true });
}

//获取收益统计
export function getUserStatistics(data) {
  return request.get("team/getUserIncomeStatistics",data,{ noAuth: true })
  }
  
  //收益 详情
  export function InfoByDate(data) {
    return request.get("team/getUserIncomeInfoByDateTime",data,{ noAuth: true })
    }

//邮箱 验证码
export function registerEmail(data) {
  return request.get("sendCodeMail",data,{ noAuth: true });
}
//提现申请
export function extract(data) {
  return request.post("extract/cash",data,{ noAuth: true });
}

//提现记录明细
export function extractRecord(data) {
  return request.get("extract/record",data,{ noAuth: true });
}

//获取团队成员信息
export function getTeamInfo(data) {
  return request.get("team/getUserInfo",data,{ noAuth: true });
}

//修改登录密码
export function editPassword(data) {
  return request.get("user/updateLoginPwd",data,{ noAuth: true });
}
//验证 原登录密码
export function rulePwd(data) {
  return request.get("user/comfirmPwd",data,{ noAuth: true });
}

//用户购买商品列表---我的商品 --
export function userProduct(data) {
  return request.get("userProduct",data,{ noAuth: true });
}

//创建普通订单 -- 商城提交订单
export function submitInfo(data) {
  return request.get("order/createCommon",data);
}


//创建普通订单 -- 商城订单详情
export function orderDetail(data) {
  return request.get(`order/detail/${data}`,{ noAuth: true });
}
//上传支付截图审核
export function imageReview(data) {
  return request.post("imageReview",data,{ noAuth: true });
}

//返回充值代理金
export function rechargeAgencyFee(data) {
  return request.get("recharge/getUserRechargeNowMoney",data,{ noAuth: true });
}
export function imageReviewConfirm(data) {
  return request.get("imageReviewConfirm",data,{ noAuth: true });
}


//预约时间
export function todayReservation(data) {
  return request.get("reservation/todayReservation",data);
}
export function withdrawalFees(data) {
  return request.get("withdrawalFees",data,{ noAuth: true });
}


export function invitLink() {
  return request.post("invitationCodeLink",{ noAuth: true });
}


export function payUserAppeal(data) {
  return request.get("payUserAppeal",data,{ noAuth: true });
}

//删除系统消息
export function sysMsgSetdetele(data) {
  return request.get("user/sysMsgSetdetele?id="+data,{ noAuth: true });
}

//消息
export function getSysMsg(data) {
  return request.get("user/getSysMsg",data,{ noAuth: true });
}

//消息
export function sysMsgSetIsRead(id) {
  return request.get(`user/sysMsgSetIsRead?id=${id}`,{ noAuth: true });
}

export function InfoPay(id) {
  return request.get(`userWarehouseSellInfoPay?id=${id}`,{ noAuth: true });
}

export function downApp() {
  return request.get('getAppLink');
}

// import {  invitationCodeLink } from '@/api/new.js';

// let that = this

// invitationCodeLink().then(res=>{
// 				console.log(res,'res');
// 			})
	// .catch(res => {
	// that.$util.Tips({
	// 	title: res
	// });
	// });